package com.mqz.zebraEcommerce.commodity.service.impl;

import com.mqz.zebraEcommerce.commodity.service.ProductBaseAttrValueService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mqz.zebraEcommerce.common.utils.PageUtils;
import com.mqz.zebraEcommerce.common.utils.Query;

import com.mqz.zebraEcommerce.commodity.dao.ProductBaseAttrValueDao;
import com.mqz.zebraEcommerce.commodity.entity.ProductBaseAttrValueEntity;

@Service("productBaseAttrValueService")
public class ProductBaseAttrValueServiceImpl extends ServiceImpl<ProductBaseAttrValueDao, ProductBaseAttrValueEntity> implements ProductBaseAttrValueService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ProductBaseAttrValueEntity> page = this.page(
                new Query<ProductBaseAttrValueEntity>().getPage(params),
                new QueryWrapper<ProductBaseAttrValueEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveProduceBaseAttr(List<ProductBaseAttrValueEntity> productBaseAttrValueEntities) {
        this.saveBatch(productBaseAttrValueEntities);
    }

}